package com.gxy.learn.design.model.behaviour.responsibility;

/**
 * @description: 责任链模式测试
 * @author: gaoxueyong
 * @Date: 2022/11/8 15:51
 */
public class Client {
    public static void main(String[] args) {
//        创建请假对象
        LeaveRequest leaveRequest = new LeaveRequest("小明",7,"身体不适");
//        创建各级领导
        GroupLeader groupLeader = new GroupLeader();
        Manager manager = new Manager();
        GeneralManager generalManager = new GeneralManager();
//        设置责任链
        groupLeader.setNextHandler(manager);
        manager.setNextHandler(generalManager);

//        领导进行审批
        groupLeader.audit(leaveRequest);

    }
}
